package com.wb3.organizer.service;

import java.util.List;

import com.wb3.organizer.dao.ContactDAO;
import com.wb3.organizer.model.Account;
import com.wb3.organizer.model.Contact;

public class ContactService {
	
	private ContactDAO dao;

	public ContactDAO getDao() {
		return dao;
	}

	public void setDao(ContactDAO dao) {
		this.dao = dao;
	}
	
	public void saveContact(Contact contact){
		dao.save(contact);
	}
	
	public void updateContact(Contact contact){
		dao.update(contact);
	}
	
	public void deleteContact(Contact contact){
		dao.delete(contact);
	}
	
	public List<Contact> listContact(Account account){
		return dao.getAll(account);
	}
	
	public Contact getContact(int con_id){
		return dao.getContactById(con_id);
	}
	
}
